﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ClientDetail.aspx.cs" Inherits="OnlineBusinesses.Areas.CustomerAdmin.ClientDetail" MasterPageFile="~/Areas/CustomerAdmin/Customer.Master" %>


<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentCustomerAdmin" runat="Server">

     <script>
         jQuery(function () {
             //$("#btnSave").click(function () {
             $(document).on('click', '#btnSave', function (event) {
                 var logo = $("#ContentCustomerAdmin_CompanyLogo").attr("src");
                 var diachi = $("#ContentCustomerAdmin_txtCompanyAddress").val();
                 var fax = $("#ContentCustomerAdmin_txtCompanyFax").val();
                 var phone = $("#ContentCustomerAdmin_txtCompanyPhone").val();
                 var email = $("#ContentCustomerAdmin_txtCompanyEmail").val();
                 var name = $("#ContentCustomerAdmin_txtCompanyName").val();
                 var url = "ClientDetail.aspx/Save";
                 //alert(logo);
                 $.ajax({
                     type: "POST",
                     url: url,
                     data: "{email:'" + email + "', name:'" + name + "', phone:'" + phone + "', fax:'" + fax + "', address:'" + diachi + "', logo:'" + logo + "'}",
                     contentType: "application/json; charset=utf-8",
                     dataType: "json",
                     success: function (data) {
                         alert('Cập nhật thành công.');
                     },
                     error: function (jqXHR, textStatus, errorThrown) {
                         // Handle errors here
                         console.log('ERRORS: ' + textStatus);
                         alert("Lưu không thành công!");
                         // STOP LOADING SPINNER
                     }
                 });
             });

         });
    </script>
    <div style="width: 100%; padding: 10px;">
        <!--start content 01-->
        <div class="col-md-12 col-xs-12 col-sm-12 col-lg-12" style="padding: 0px; border: 0px solid #333;">
            <div class="col-md-12 col-xs-12 col-sm-12 col-lg-12" style="padding: 10px 20px; background: none; color: #333; font-size: 18px; font-weight: bold; position: relative;">
                Thông tin tài khoản -
                <asp:Label ID="lblEmail" runat="server" Style="color: #333;" Text=""></asp:Label>
            </div>

            <div class="col-md-12 col-xs-12 col-sm-12 col-lg-12" style="padding: 0px;">
                <asp:Panel Visible="false" ID="pnError" runat="server">
                    <div class="error-box round" style="padding-top: 10px;">
                        <asp:Label ID="lblError" runat="server" Text=""></asp:Label>
                    </div>
                </asp:Panel>
                <asp:Panel Visible="false" ID="pnSuccess" runat="server">
                    <div class="confirmation-box round" style="padding-top: 10px;">
                        <asp:Label ID="lblSuccess" runat="server" Text=""></asp:Label>
                    </div>
                </asp:Panel>
            </div>
            <div class="col-md-12 col-xs-12 col-lg-12 col-sm-12" style="padding: 5px 0px; vertical-align: middle;">
                <div class="col-md-12 col-xs-12 col-lg-12 col-sm-12" style="padding: 0px;">
                    <h3>Thông tin công ty</h3>
                    <div class="col-md-12 col-xs-12 col-sm-12 col-lg-12" style="padding: 0px; margin-bottom: 5px;">
                        <div class="col-md-2 col-lg-2 col-sm-12 col-xs-12" style="vertical-align: middle; text-align: center; padding: 15px 0px;">
                            <img class="img img-thumbnail" id="CompanyLogo" runat="server" style="cursor: pointer; width: 200px; height: 75px;" data-toggle="tooltip" data-placement="right" title="Hình ảnh đẹp tại 250 x 85" />
                            <input class="hidden" type="file" onchange="readURL2(this);" id="data_input" />
                            
                        </div>
                        <div class="col-md-6 col-lg-6 col-sm-12 col-xs-12" style="vertical-align: middle; text-align: center; padding: 10px;">
                            <div class="col-md-12 col-xs-12 col-sm-12 col-lg-12" style="padding: 5px;">
                                <asp:TextBox ID="txtCompanyName" runat="server" type="text" class="input_add" placeholder="Tên công ty .." />
                            </div>
                            <div class="col-md-4 col-xs-12 col-lg-4 col-sm-12" style="padding: 5px;">
                                <asp:TextBox ID="txtCompanyPhone" runat="server" type="text" class="input_add" placeholder="Điện thoại .." />
                            </div>

                            <div class="col-md-4 col-xs-12 col-lg-4 col-sm-12" style="padding: 5px;">
                                <asp:TextBox ID="txtCompanyFax" runat="server" type="text" class="input_add" placeholder="Fax .." />
                            </div>
                            <div class="col-md-4 col-xs-12 col-lg-4 col-sm-12" style="padding: 5px;">
                                <asp:TextBox ID="txtCompanyEmail" runat="server" type="text" class="input_add" placeholder="Email .." />
                            </div>
                        </div>
                        <div class="col-md-4 col-xs-12 col-lg-4 col-sm-12" style="vertical-align: middle; text-align: center; padding: 10px;">
                            <asp:TextBox ID="txtCompanyAddress" runat="server" Style="height: 90px; resize: none;" TextMode="multiline" type="text" class="input_add" placeholder="Địa chỉ .." />
                        </div>
                    </div>
                    <div class="col-md-12 col-lg-12 col-sm-12" style="padding: 10px 10px;text-align:right;border-bottom:1px solid #ddd;">
                        <span class="btn btn-default" onclick="ShowProgress();" style="border-radius: 0px; color: #aaa" id="btnSave">Cập nhật</span>
                    </div>
                </div>
            </div>
            <div class="col-md-12 col-xs-12 col-sm-12 col-lg-12" style="height: auto; padding: 5px;">
                    <div class="col-md-6 col-xs-12 col-sm-12 col-lg-6" style="height: auto; padding: 0px 10px;">
                        <h3><b>Gói dịch vụ</b></h3>
                        <div class="col-md-12 col-xs-12 col-sm-12 col-lg-12" style="height: auto; padding: 10px 0px;">
                            <div class="col-xs-12 col-md-12 col-lg-12 col-sm-12" style="padding: 5px 0px;">
                                <div class="col-md-6 col-xs-6 col-sm-6 col-lg-6" style="text-transform: none; padding: 0px;">
                                    Gói sử dụng
                                </div>
                                <div class="col-md-6 col-xs-6 col-sm-6 col-lg-6" style="font-weight: bold; text-transform: none; color: #52964F; padding: 0px; text-align: left;">
                                    <asp:Label ID="lblTenGoi" runat="server" Text=""></asp:Label>
                                </div>
                            </div>


                            <div class="col-xs-12 col-md-12 col-lg-12 col-sm-12" style="padding: 5px 0px;">
                                <div class="col-md-6 col-xs-8 col-sm-8 col-lg-6" style="text-transform: none; padding: 0px;">
                                    Số tài khoản con
                                </div>
                                <div class="col-md-6 col-xs-4 col-sm-4 col-lg-6" style="font-weight: bold; text-transform: none; padding: 0px; text-align: left;">
                                    <asp:Label ID="lblSoTaiKhoanCon" runat="server" Text=""></asp:Label>
                                </div>
                            </div>
                            <div class="col-xs-12 col-md-12 col-lg-12 col-sm-12" style="padding: 5px 0px;">
                                <div class="col-md-6 col-xs-6 col-sm-6 col-lg-6" style="text-transform: none; padding: 0px;">
                                    Ngày kích hoạt:
                                </div>
                                <div class="col-md-6 col-xs-6 col-sm-6 col-lg-6" style="font-weight: bold; text-transform: none; padding: 0px; text-align: left;">
                                    <asp:Label ID="lblNgayKichHoat" runat="server" Text=""></asp:Label>
                                </div>
                            </div>
                            <div class="col-xs-12 col-md-12 col-lg-12 col-sm-12" style="padding: 5px 0px;">
                                <div class="col-md-6 col-xs-6 col-sm-6 col-lg-6" style="text-transform: none; padding: 0px;">
                                    Ngày hết hạn:
                                </div>
                                <div class="col-md-6 col-xs-6 col-sm-6 col-lg-6" style="font-weight: bold; text-transform: none; padding: 0px; text-align: left;">
                                    <asp:Label ID="lblNgayDenHan" runat="server" Text=""></asp:Label>
                                </div>
                            </div>
                            <div class="col-xs-12 col-md-12 col-lg-12 col-sm-12" style="padding: 5px 0px;">

                                <div class="col-md-6 col-xs-12 col-sm-12 col-lg-6" style="text-transform: none; padding: 0px;">
                                    Giới hạn email gửi
                                </div>
                                <div class="col-md-6 col-xs-12 col-sm-12 col-lg-6" style="font-weight: bold; text-transform: none; padding: 0px; text-align: left;">
                                    <asp:Label ID="lblSoLuongEmail" runat="server" Text=""></asp:Label>
                                </div>
                            </div>
                            <div class="col-xs-12 col-md-12 col-lg-12 col-sm-12" style="padding: 5px 0px;">
                                <div class="col-md-6 col-xs-12 col-sm-12 col-lg-6" style="text-transform: none; padding: 0px;">
                                    Hạn nghạch gửi:
                                </div>
                                <div class="col-md-6 col-xs-12 col-sm-12 col-lg-6" style="font-weight: bold; text-transform: none; padding: 0px; text-align: left;">
                                    <asp:Label ID="lblGioiHanEmail" runat="server" Text=""></asp:Label>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-12 col-xs-12 col-sm-12 col-lg-12" id="formExtend" runat="server" style="height: auto; padding: 10px 10px; text-align: center;">
                            <div class="col-md-6 col-xs-12 col-sm-12 col-lg-6" style="padding: 5px;">
                                <button id="btnExtend" onclick="ShowProgress();"  runat="server" class="btn btn-default menublue" style="background: #eee; border-radius: 0px; width: 100%;" onserverclick="btnGiahan_Click">
                                    <i class="fa fa-wrench" style="margin-right: 10px;"></i>Gia hạn
                                </button>
                            </div>
                            <div class="col-md-6 col-xs-12 col-sm-12 col-lg-6" style="padding: 5px;">
                                <button id="btnUpgrade" onclick="ShowProgress();"  runat="server" class="btn btn-default menublue" style="background: #eee; border-radius: 0px; width: 100%;" onserverclick="btnUpGradeServices_Click">
                                    <i class="fa fa-upload" style="margin-right: 10px;"></i>Nâng cấp
                                </button>
                            </div>
                        </div>
                        <asp:Panel runat="server" ID="pnlThanhToan" Visible="false">
                            <div class="col-xs-12 col-md-12" style="padding:10px;border:1px solid #fd0;background:#ffe;">
                                <asp:Label ID="Label1" runat="server" style="font-size:14px;font-weight:bold;" Text="Giao dịch của bạn đang chờ thành toán. Vui lòng tiếp tục thanh toán.">
                                </asp:Label>
                                <div class="col-xs-12 col-md-12">
                                    <div class="col-md-6 col-xs-12 col-sm-12 col-lg-6" style="padding: 5px;">
                                        <asp:LinkButton ID="LinkButton1" class="btn btn-default menublue" Style="background: #eee; border-radius: 0px; width: 100%;" PostBackUrl="~/Areas/CustomerAdmin/Payment.aspx" runat="server" Text="Thanh toán" />
                                    </div>
                                    <div class="col-md-6 col-xs-12 col-sm-12 col-lg-6" style="padding: 5px;">
                                        <asp:Button runat="server" class="btn btn-default menublue" Style="background: #eee; border-radius: 0px; width: 100%;" Text="Huỷ Giao dịch" ID="btnCancel" OnClick="btnCancel_Click" OnClientClick="return confirm('Bạn có chắc là muốn huỷ không!','Xác nhận người dùng ');" />
                                    </div>
                                </div>
                            </div>
                        </asp:Panel>
                    </div>
                    <div class="col-md-6 col-xs-12 col-sm-12 col-lg-6" style="height: auto; padding: 0px 10px;">
                        <div class="col-md-12 col-xs-12 col-sm-12 col-lg-12" style="height: auto; padding: 0px;">
                                <h3><b>Các tính năng</b></h3>
                                <asp:Repeater ID="rptFunction" runat="server">
                                    <ItemTemplate>
                                        <div class="col-md-6 col-lg-6 col-sm-12 col-xs-12" style="padding: 5px;">
                                            <div style="color: #333; font-weight:bold; padding:5px 10px; text-align: left;font-size:13px;">
                                                <span class="fa fa-caret-right" style="margin-right:5px;"></span><%#Eval("functionName") %>
                                            </div>
                                        </div>
                                    </ItemTemplate>
                                </asp:Repeater>
                        </div>
                   </div>
                   <asp:Button ID="btnGiahan" runat="server" Style="background: #333; color: #fff; border-radius: 0px; padding: 5px 14px;margin:20px 0px;" OnClick="btnGiahan_Click" />
            </div>
            <asp:HiddenField runat="server" ID="hdfUnPaidRegisterID" />
        </div>
    </div>

    
</asp:Content>

